<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
  <head>
    <title>订单列表</title>
	<link rel="stylesheet" href="${pageContext.request.contextPath}/cts/css/style.css" type="text/css" />
	<script type="text/javascript" src="${pageContext.request.contextPath}/cts/js/jquery.js"></script>
	<script type="text/javascript" src="${pageContext.request.contextPath}/cts/js/common.js"></script>
	<script type="text/javascript" src="${pageContext.request.contextPath}/cts/js/jquery.bgiframe.js"></script>
	<script type="text/javascript" src="${pageContext.request.contextPath}/cts/js/popdiv.js"></script>
	<script type="text/javascript" src="${pageContext.request.contextPath}/cts/js/DatePicker.js"></script>
	<script type="text/javascript" src="${pageContext.request.contextPath}/cts/js/searchdata.js"></script>
	<script type="text/javascript" src="${pageContext.request.contextPath}/cts/js/My97DatePicker/WdatePicker.js"></script>
  	<script src="${pageContext.request.contextPath}/cts/js/workDetailTip/jquery.hoverIntent.minified.js" type="text/javascript" charset="utf-8"></script>
	<!--[if IE]><script src="${pageContext.request.contextPath}/cts/js/workDetailTip/excanvas.js" type="text/javascript" charset="utf-8"></script><![endif]-->
	<script src="${pageContext.request.contextPath}/cts/js/workDetailTip/jquery.bt.min.js" type="text/javascript" charset="utf-8"></script>
	<script src="${pageContext.request.contextPath}/cts/js/workDetailTip/jquery.easing.1.3.js" type="text/javascript" charset="utf-8"></script>
  	<style>
  	.left{ margin: 0;}
	.left span{
		margin: 2px 3px 2px 1px;_margin: 2px 5px 2px 1px;padding: 0 4px 0 0px; cursor: pointer;width: 60px;
	 }
	 .left .on{ border-left:1px solid #898989; border-right:1px solid #898989; margin: 2px 2px 2px 0px;_margin: 2px 4px 2px 0px;}
	body{
	font-size:63%\0;
	}
  	</style>
  
  </head>
  <jsp:include page="../im/importIm.jsp?switchFlag=true"></jsp:include>
  <body style="text-align: left;" >
  	<jsp:include page="${pageContext.request.contextPath}/pages/common/pageForm.jsp"></jsp:include>
  	<div id="mainTop" style="margin-top:0px;border: 0px solid red;">
	    <jsp:include flush="true" page="../top.jsp?place=2"></jsp:include>
	</div>
  	<form action="" id="searchForm">
  	<s:hidden name="pageSize" id="pageSize"></s:hidden>
    <s:hidden name="pageNumber" id="pageNumber"></s:hidden>
    <input type="hidden" name="itemType" id="itemType" value="0"/>
    
  	<div style="width: 998px; margin: 0 auto;border: 0px solid red;_margin-top:-10px; padding-top: 5px;font-size:12px;">
  		<div style="width: 958px;border: 0px solid red;text-align: right;padding-right: 20px;padding-left: 20px;">
  			<input type="radio" name="item" onclick="changeToPage(1);" checked="checked"/>&nbsp;订单管理
  			&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  			<input type="radio" name="item" onclick="changeToPage(2);"/>&nbsp;财务管理
  		</div>
  		<div style="width: 978px; height: 80px; border: 0px solid yellow;">
  			<div style="float: left;width: 200px;border: 0px solid red;height: 80px; padding-left: 30px;_ padding-left: 0px;cursor: pointer;" onclick="goHome();">
  				<img src="${pageContext.request.contextPath}/cts/images/index_logo.jpg" style="margin-top:20px;"/>
  			</div>
  			<div style="float: left;width:744px; border: 0px solid red;height: 80px;">
  				<div id="status_div_" class="left" style="float: left;width:764px;text-align: left;padding-left: 10px;line-height: 22px;height: 24px;font-size:12px;font-family:arial;">
  					<span id="span_parent_1" onclick="changeItem(1);" style="cursor: pointer;"><span id="span_text_1" onmousemove="changeStyle1(1)" onmouseout="changeStyle2(1)">FCL</span><span id="span_1" class="count_num"></span></span>
  					<span id="span_parent_2" onclick="changeItem(2);" style="cursor: pointer;"><span id="span_text_2" onmousemove="changeStyle1(2)" onmouseout="changeStyle2(2)">LCL</span><span id="span_2" class="count_num"></span></span>
  					<span id="span_parent_3" onclick="changeItem(3);" style="cursor: pointer;"><span id="span_text_3" onmousemove="changeStyle1(3)" onmouseout="changeStyle2(3)">AIR</span><span id="span_3" class="count_num"></span></span>
  					<span id="span_parent_4" onclick="changeItem(4);" style="cursor: pointer;"><span id="span_text_4" onmousemove="changeStyle1(4)" onmouseout="changeStyle2(4)">EXPRESS</span><span id="span_4" class="count_num"></span></span>
  					<span id="span_parent_5" onclick="changeItem(5);" style="cursor: pointer;"><span id="span_text_5" onmousemove="changeStyle1(5)" onmouseout="changeStyle2(5)">TRUCKING</span><span id="span_5" class="count_num"></span></span>
  					<span id="span_parent_6" onclick="changeItem(6);" style="cursor: pointer;"><span id="span_text_6" onmousemove="changeStyle1(6)" onmouseout="changeStyle2(6)">其他</span><span id="span_6" class="count_num"></span></span>
  				</div>
  				
  				<div style="text-align: left;width:744px;clear: both;">
  					<div style="float:left;border:0px solid red;height:49px;width:532px;background: url(${pageContext.request.contextPath}/cts/images/work_search.jpg);">
						<div style="float:left;padding-top:11px;padding-left:45px;border:0px solid red;">
							<input style="border:0px solid red; width:400px; height:25px;vertical-align: middle; line-height: 25px" class="input_tip" type="text" name="keyword" id="keyword"/>
						</div>
						<div style="float:left;border:0px solid red;width:65px;height:38px;margin-left: 10px;cursor: pointer;" onclick="searchDataOr();">
							&nbsp;
						</div>
					</div>
						
  					<div style="float: left;height: 50px;line-height: 50px;padding-left: 10px;">
	  					<a href="javascript:advanceSearch();">高级搜索</a>
  					</div>
  				</div>
  			</div>
  		</div>
  		<!-- 高级搜索内容 -->
		<div id="advance_div" style="width: 964px;border: 0px solid red;width: 700px;display: none;" class="popdiv_inner">
			<div class="popdiv_inner_outter"></div>
			<div class="popdiv_close" onclick="javascript:$('#keyword').pleaseInput('<s:text name="cts.work.searchDefault"/>',{'font-style':'italic','color':'#C5C3C4'})"></div>
			<div class="popdiv_handle" title="鼠标左键按住可拖动">高级搜索内容</div>
			<div class="popdiv_content" style="text-align: center;">
				<table style="width: 100%" border="0">
					<tr>
						<td align="right">
							订单号
						</td>
						<td align="left">
							<input type="text" name="workCode" id="workCode"/>
						</td>
						<td align="right">
							委托方
						</td>
						<td align="left">
							<input type="text" name="client1" id="client1"/>
						</td>
					</tr>
					<tr>
						<td align="right">
							委托月份
						</td>
						<td align="left">
							<input type="text" name="delegateTime" id="delegateTime" onclick="setmonth(this,'yyyy-MM','2012-01-01','2020-12-30',0)" readonly="readonly">
						</td>
					
						<td align="right">
							团队成员
						</td>
						<td align="left">
							<input type="text" name="team" id="team"/>
						</td>
					</tr>
					<tr>
						<td align="right">
							标签
						</td>
						<td align="left">
							<input type="text" name="tag" id="tag"/>
						</td>
						<td align="right">
							货物名称
						</td>
						<td align="left">
							<input type="text" name="cargoName" id="cargoName"/>
						</td>
					</tr>
					<tr>
						<td align="right">
							作业项目名称
						</td>
						<td align="left">
							<input type="text" name="itemName" id="itemName"/>
						</td>
						
						<td align="right">
							服务商
						</td>
						<td align="left">
							<input type="text" name="serviceName" id="serviceName"/>
						</td>
					</tr>
					<tr>
						<td align="right">
							作业时间
						</td>
						<td align="left" colspan="3">
							<input type="text" name="startTime" id="startTime" onclick="WdatePicker()" readonly="readonly"/>到<input type="text" name="endTime" id="endTime" onclick="WdatePicker()" readonly="readonly"/>
						</td>
						
						
					</tr>
				
					<!-- FCL LCL查询字段 -->
					<tr class="fcl_lcl_li" style="display: none;">
						<td align="right">
							出发地
						</td>
						<td align="left">
							<input type="text" name="pointORGName_fcl" id="pointORGName_fcl" disableautocomplete autocomplete="off" 
							onkeyup="seachDataByKeyword('searchPointBykeyword.action?type=1&portType=0',this.value,'pointORGName_fcl','pointORGName_fcl_id',0,240);">
							<input type="hidden" name="pointORGName_fcl_id" id="pointORGName_fcl_id" />
						</td>
						<td align="right">
							目的地
						</td>
						<td align="left">
							<input type="text" name="pointDES_fcl" id="pointDES_fcl" disableautocomplete autocomplete="off" 
							onkeyup="seachDataByKeyword('searchPointBykeyword.action?type=1&portType=0',this.value,'pointDES_fcl','pointDES_fcl_id',0,240);"/>
							<input type="hidden" name="pointDES_fcl_id" id="pointDES_fcl_id" />
						</td>
					</tr>
					<tr class="fcl_lcl_li" style="display: none;">
						<td align="right">
							箱量/柜号
						</td>
						<td align="left">
							<input type="text" name="boxAmount_fcl" id="boxAmount_fcl"/>
						</td>
						<td align="right">
							船名
						</td>
						<td align="left">
							<input type="text" name="oceanVessel1_fcl" id="oceanVessel1_fcl"/>
						</td>
					</tr>
					<tr class="fcl_lcl_li" style="display: none;">
						<td align="right">
							订舱号
						</td>
						<td align="left">
							<input type="text" name="bookingNumber_fcl" id="bookingNumber_fcl"/>
						</td>
						<td align="right">
							提单号
						</td>
						<td align="left">
							<input type="text" name="blNumber_fcl" id="blNumber_fcl"/>
						</td>
					</tr>
				
					<tr class="fcl_lcl_li" style="display: none;">
						<td align="right">
							船东
						</td>
						<td align="left">
							<select name="carrierName_fcl" id="carrierName_fcl">
								<option value="0">--请选择--</option>
							</select>
						</td>
						<td align="right">
						</td>
						<td align="left">
						</td>
					</tr>
					
					<!-- AIR查询字段 -->
					<tr class="air_li" style="display: none;">
						<td align="right">
							出发地
						</td>
						<td align="left">
							<input type="text" name="pointORGName_air" id="pointORGName_air"  disableautocomplete autocomplete="off" 
							onkeyup="seachDataByKeyword('searchPointBykeyword.action?type=3&portType=2',this.value,'pointORGName_air','pointORG_air_id',0,240);"/>
							<input type="hidden" name="pointORG_air_id" id="pointORG_air_id"/>
						</td>
						<td align="right">
							目的地
						</td>
						<td align="left">
							<input type="text" name="pointDES_air" id="pointDES_air"  disableautocomplete autocomplete="off" 
							onkeyup="seachDataByKeyword('searchPointBykeyword.action?type=3&portType=2',this.value,'pointDES_air','pointDES_air_id',0,240);"/>
							<input type="hidden" name="pointDES_air_id" id="pointDES_air_id"/>
						</td>
					</tr>
					<tr class="air_li" style="display: none;">
						<td align="right">
							航班号
						</td>
						<td align="left">
							<input type="text" name="voyNo2_air" id="voyNo2_air"/>
						</td>
						<td align="right">
							空运单号
						</td>
						<td align="left">
							<input type="text" name="bookingNumber_air" id="bookingNumber_air"/>
						</td>
					</tr>
				
					<tr class="air_li" style="display: none;">
						<td align="right">
							航空公司
						</td>
						<td align="left">
							<select name="carrier_air" id="carrier_air">
							<option value="0">--请选择--</option>
							<s:iterator value="#request.carrier_air">
								<option value="<s:property value="id"/>"><s:property value="name_zh"/></option>
							</s:iterator>
						</select>
						</td>
						<td align="right">
						</td>
						<td align="left">
						</td>
					</tr>
					<!-- EXPRESS 查询字段 -->
					<tr class="express_li" style="display: none;">
						<td align="right">
							出口国
						</td>
						<td align="left">
							<input type="text" name="expressExportCountry_exp" id="expressExportCountry_exp"  disableautocomplete autocomplete="off" 
							onkeyup="seachDataByKeyword('searchCountryBykeyword.action?maxlen=2',this.value,'expressExportCountry_exp','expressExportCountry_exp_id',0,240);"/>
							<input type="hidden" name="expressExportCountry_exp_id" id="expressExportCountry_exp_id"/>
						</td>
						<td align="right">
							进口国
						</td>
						<td align="left">
							<input type="text" name="expressImportCountry_exp" id="expressImportCountry_exp" disableautocomplete autocomplete="off" 
							onkeyup="seachDataByKeyword('searchCountryBykeyword.action?maxlen=2',this.value,'expressImportCountry_exp','expressImportCountry_exp_id',0,240);"/>
							<input type="hidden" name="expressImportCountry_exp_id" id="expressImportCountry_exp_id"/>
						</td>
					</tr>
					<tr class="express_li" style="display: none;">
						<td align="right">
							运单号
						</td>
						<td align="left">
							<input type="text" name="expressBookingNumber_exp" id="expressBookingNumber_exp"/>
						</td>
						<td align="right">
							快递公司
						</td>
						<td align="left">
							<select name="expressCarrier_exp" id="expressCarrier_exp">
								<option value="0">--请选择--</option>
								<s:iterator value="#request.expressCarrier_exp">
									<option value="<s:property value="id"/>"><s:property value="name_zh"/></option>
								</s:iterator>
							</select>
						</td>
					</tr>
					<!-- TRUCKING -->
					<tr class="car_li" style="display: none;">
						<td align="right">
							出发地
						</td>
						<td align="left">
							<input type="text" name="pointORG_car" id="pointORG_car"disableautocomplete autocomplete="off" 
							onkeyup="seachDataByKeyword('searchPointBykeyword.action?type=1&portType=2',this.value,'pointORG_car','pointORG_car_id',0,240);"/>
							<input type="hidden" name="pointORG_car_id" id="pointORG_car_id"/>
						</td>
						<td align="right">
							目的地
						</td>
						<td align="left">
							<input type="text" name="pointDES_car" id="pointDES_car" disableautocomplete autocomplete="off" 
							onkeyup="seachDataByKeyword('searchPointBykeyword.action?type=1&portType=2',this.value,'pointDES_car','pointDES_car_id',0,240);"/>
							<input type="hidden" name="pointDES_car_id" id="pointDES_car_id"/>
						</td>
					</tr>
					<tr class="car_li" style="display: none;">
						<td align="right">
							车牌号
						</td>
						<td align="left">
							<input type="text" name="truckingCarNumber_car" id="truckingCarNumber_car">
						</td>
						<td align="right">
							订舱号
						</td>
						<td align="left">
							<input type="text" name="bookingNumber_car" id="bookingNumber_car">
						</td>
					</tr>
					<tr class="car_li" style="display: none;">
						<td align="right">
							箱量/柜号
						</td>
						<td align="left">
							<input type="text" name="boxAmount_car" id="boxAmount_car">
						</td>
						<td align="right">
						</td>
						<td align="left">
						</td>
					</tr>
					
					<tr>
						<td colspan="4"><input type="button" onclick="searchDataAdvance();" value="确定"/></td>
					</tr>
			    </table>
			</div>
		</div>
  					
  		<div style="width: 958px;border: 0px solid green;clear: both;height: 42px;padding-left: 20px;padding-right: 20px;">
  			<div style="width: 100%;height: 42px;margin:0;background: url('${pageContext.request.contextPath}/cts/images/hr_line.jpg') repeat-x bottom right;">
	  			<div style="float: left;text-align: left;width: 474px;vertical-align: middle;_padding-top:5px;line-height: 36px;margin:0;padding-top: 10px;">
	  				<span id="sleBG">     
						<span id="sleHid">   
			  				<select name="workingStatus" class="select" id="workingStatus" onchange="searchDataChange( this.value);">
			  					<option value="0">全部操作状态</option>
			  					<option value="1">计划</option>
			  					<option value="2">进行</option>
			  					<option value="3">完成</option>
			  					<option value="4">暂停</option>
			  					<option value="5">已归档</option>
			  				</select>
		  				</span>
	  				</span>
	  			</div>
	  			<div style="float: right;width: 474px;text-align: right;margin:0;">
	  				<table id="search_bnt_tab" width="width: 475px;" align="right" border="0" cellpadding="0" cellspacing="0">
	  					<tr>
	  						<s:if test="#request.e.auth1==1 || #cts_emplcpyid == #cts_companyid">
	  							<td id="operate_a_1" class="target" title=""><a class="a1" href="javascript:showAddDiv();" title="">创建</a></td>
	  						</s:if>
	  						<td><a class="a2" href="#">复制</a></td>
	  						<td id="operate_a_3" class="target" title=""><a class="a3" href="javascript:statisticalWorkDiv();" title="">统计</a></td>
	  					</tr>
	  				</table>
	  			</div>
  			</div>
  		</div>	
  		<!--  
		<div id="add_work_div" style="width: 146px;position: absolute;right:0;">
	       <s:iterator value="#request.items" status="sta">
	       <s:if test="#sta.index==#request.items.size()-1"></s:if>
	       		<div id ="item_detail_div" style=" <s:if test="#sta.index!=#request.items.size()-1">border-bottom: 1px solid #31bc15;</s:if>text-align: left;padding: 0;margin: 0;width:146px;">
		       		<a href="javascript:addWork('<s:property value="id"/>')" >
		       			<div>创建<s:property value="name_zh"/></div>
		       		</a>
	       		</div>
	       		<s:if test="#sta.index!=#request.items.size()-1">
		       		<div style="border-bottom: 1px solid #fff;height: 1px;">
		       		</div>
	       		</s:if>
	       </s:iterator>
		</div>
		-->
		<div id="add_work_div" style="position: relative;float: right;width: 176px;border:0px solid red;z-index:10000;padding-top: 0px;padding-right: 6px;">
			<div id="add_work_div_item" style="text-align: right;border: 1px solid #b6bcc1;background-color: white;position: absolute;display: none;" >
				<div class="div_up">&nbsp;</div>
				<div style="padding:10px 15px 15px 15px;">
					<div style="border-left: 1px solid #7B7E73;border-right: 1px solid #7B7E73;border-top: 1px solid #7B7E73;">
						<div id ="item_detail_div" style="height:25px;line-height:25px;border-bottom: 1px solid #7B7E73;text-align: left;color:#383838;padding: 0;margin: 0;width:146px;<s:if test="#sta.Even">background-color:#e7eada;</s:if><s:else>background-color: #e7edd3</s:else>">
				       		<a href="javascript:addWork('1')" >
				       			<div>创建FCL</div>
				       		</a>
			       		</div>
			       		<div id ="item_detail_div" style="height:25px;line-height:25px;border-bottom: 1px solid #7B7E73;text-align: left;color:#383838;padding: 0;margin: 0;width:146px;<s:if test="#sta.Even">background-color:#e7eada;</s:if><s:else>background-color: #e7edd3</s:else>">
				       		<a href="javascript:addWork('2')" >
				       			<div>创建LCL</div>
				       		</a>
			       		</div>
			       		<div id ="item_detail_div" style="height:25px;line-height:25px;border-bottom: 1px solid #7B7E73;text-align: left;color:#383838;padding: 0;margin: 0;width:146px;<s:if test="#sta.Even">background-color:#e7eada;</s:if><s:else>background-color: #e7edd3</s:else>">
				       		<a href="javascript:addWork('3')" >
				       			<div>创建AIR</div>
				       		</a>
			       		</div>
			       		<div id ="item_detail_div" style="height:25px;line-height:25px;border-bottom: 1px solid #7B7E73;text-align: left;color:#383838;padding: 0;margin: 0;width:146px;<s:if test="#sta.Even">background-color:#e7eada;</s:if><s:else>background-color: #e7edd3</s:else>">
				       		<a href="javascript:addWork('4')" >
				       			<div>创建EXPRESS</div>
				       		</a>
			       		</div>
			       		<div id ="item_detail_div" style="height:25px;line-height:25px;border-bottom: 1px solid #7B7E73;text-align: left;color:#383838;padding: 0;margin: 0;width:146px;<s:if test="#sta.Even">background-color:#e7eada;</s:if><s:else>background-color: #e7edd3</s:else>">
				       		<a href="javascript:addWork('5')" >
				       			<div>创建TRUCKING</div>
				       		</a>
			       		</div>
			       		<div id ="item_detail_div" style="height:25px;line-height:25px;border-bottom: 1px solid #7B7E73;text-align: left;color:#383838;padding: 0;margin: 0;width:146px;<s:if test="#sta.Even">background-color:#e7eada;</s:if><s:else>background-color: #e7edd3</s:else>">
				       		<a href="javascript:addWork('6')" >
				       			<div>创建其他</div>
				       		</a>
			       		</div>
			       </div>
		       </div>
			</div>
			<div style="clear: both;">
			</div>
		</div>
		
				
		<div id="add_work_div2" style="position:absolute;float: right;width: 176px;border:0px solid red;z-index:10000;padding-top: 0px;padding-right: 6px;margin-left:880px;">
			<div id="statistical_work_div" style="text-align: right;border: 1px solid #b6bcc1;background-color: white;position: absolute;display:none;" >
				<div class="div_up">&nbsp;</div>
				<div style="padding:10px 15px 15px 15px;">
					<div style="border-left: 1px solid #7B7E73;border-right: 1px solid #7B7E73;border-top: 1px solid #7B7E73;">
				       		<div id ="item_detail_div" style="height:25px;line-height:25px;border-bottom: 1px solid #7B7E73;text-align: left;color:#383838;padding: 0;margin: 0;width:146px;background-color: #e7edd3;">
					       		<a target="statistical3" href="toStatisticalWorks?statisticalType=3" >按委托方统计</a>
				       		</div>
				       		<div id ="item_detail_div" style="height:25px;line-height:25px;border-bottom: 1px solid #7B7E73;text-align: left;color:#383838;padding: 0;margin: 0;width:146px;background-color: #e7eada;">
					       		<a target="statistical4" href="toStatisticalWorks?statisticalType=4" >按员工统计</a>
				       		</div>
				       		<div id ="item_detail_div" style="height:25px;line-height:25px;border-bottom: 1px solid #7B7E73;text-align: left;color:#383838;padding: 0;margin: 0;width:146px;background-color: #e7eada;">
					       		<a target="statistical5" href="toStatisticalWorks?statisticalType=5" >按服务商统计</a>
				       		</div>
			       </div>
		       </div>
			</div>
			<div style="clear: both;">
			</div>
		</div>
		
		
  		<input type="hidden" id="urlforward" value="searchWork.action" />
		<div id="pagination" valign="middle" class="pagination" ></div>
		<!-- 具体内容 -->
	  	<div id="workResult" style="height: auto;text-align: center;width: 988px;padding-left: 10px;">
	  		
	  	</div>
	  	
  	</div>
  	<input type="hidden" id="seachType" name="seachType" value="1" />
  	</form>
  	<script>
		 var o = document.getElementById('add_work_div_item');
		 o.onmouseover = function(){
		 	$('#add_work_div_item').show();
		 }
		 o.onmouseout = function(){
		    $('#add_work_div_item').hide();
		 }
		 
		 var oo = document.getElementById('statistical_work_div');
		 oo.onmouseover = function(){
		 	$('#statistical_work_div').show();
		 }
		 oo.onmouseout = function(){
		    $('#statistical_work_div').hide();
		 }
		 
		 function statisticalWorkDiv(){
			$('#add_work_div_item').hide();
	 	    $('#statistical_work_div').show();
		 }
		 
		 
		var itemType = 0;
		var seachType = 1;
		function changeItem( val ){
			itemType = val;
			$('#itemType').val(itemType);
			if( $("#advance_div").is(":visible") ){
				advanceSearch(1);
			}
			
			heartBeat();
			$("#workResult").html('');
		    pageNumberVal = 1;
		    $("#pageNumber").val(1);
			searchResult();
			changeTopSpan( val );
			
		}
		function advanceSearch(val){
			if( val!=1 ){
				if( $("#advance_div").is(":visible") ){
					$("#advance_div").hide();
					seachType = 1;
					clearAdvanceVal();
					return;
				}
			}
			$('#keyword').val('');
			seachType = 2;
			
			if( itemType == 0 ){
				$(".fcl_lcl_li").hide();
				$(".air_li").hide();
				$(".express_li").hide();
				$(".car_li").hide();
			}else if( itemType == 1 || itemType == 2 ){
				$(".air_li").hide();
				$(".express_li").hide();
				$(".car_li").hide();
				$("#carrierName_fcl").empty();
				$("#carrierName_fcl").append("<option value='0'>--请选择--</option>"); 
				if( itemType == 1 ){
					<s:iterator value="#request.carrier_fcl">
						$("#carrierName_fcl").append("<option value='<s:property value="id"/>'><s:property value="name_zh"/></option>");  
					</s:iterator>
				}else{
					<s:iterator value="#request.carrier_lcl">
						$("#carrierName_fcl").append("<option value='<s:property value="id"/>'><s:property value="name_zh"/></option>");  
					</s:iterator>
				}
				$(".fcl_lcl_li").show();
			}else if( itemType == 3 ){
				$(".fcl_lcl_li").hide();
				$(".express_li").hide();
				$(".car_li").hide();
				$(".air_li").show();
			}else if( itemType == 4 ){
				$(".fcl_lcl_li").hide();
				$(".air_li").hide();
				$(".car_li").hide();
				$(".express_li").show();
			}else if( itemType == 5 ){
				$(".fcl_lcl_li").hide();
				$(".air_li").hide();
				$(".express_li").hide();
				$(".car_li").show();
			}
			openPopDiv('advance_div','',200);
			//$("#advance_div").show();
		}
		
		$(function(){
			$.ajax({//获取计划，进行，完成，暂停数据
				type : "POST",
				url : "getCountByType.action",
				success : function(data) {
					var arr= data.split(",");
					$("#span_1").html(arr[0]);
					$("#span_2").html(arr[1]);
					$("#span_3").html(arr[2]);
					$("#span_4").html(arr[3]);
					$("#span_5").html(arr[4]);
					$("#span_6").html(arr[5]);
				}
			});
		 	$('td>input').css('width','120');
			$('td>select').css('width','120');
			//$(':input>button').css('width','90');
			$('input[type=button]').css('width','60');
			//$('td>input>button').css('width','90');
		})
			
	  	$(function(){
	  		var keyword="<s:property value="keyword"/>";
	  		if(keyword!=""){
	  			$('#keyword').val(keyword);
	  		}else{
				$('#keyword').pleaseInput('<s:text name="cts.work.searchDefault"/>',{'font-style':'italic','color':'#C5C3C4'});
			}
			if( $.browser.msie &&  $.browser.version==6 ){
			}else{
				$('body').css("overflow-y", "scroll");
			}
		});
	  	
	  	var pageNumberVal = 1;
	    var isScroll = true;
	     
	         
	  	$(function(){
			searchResult();
			window.onscroll=scroll;
		})
		
	    //是否加载完全部货盘了  
		function isAllReuslt(){
			var isLast = $("#isLast").val();
			if(isLast == 1 ){
				return true;
			}else{
				return false;
			}
		}
		
  		//滚动条滚到底事件
		function scroll(){
			if(reachBottom() && isScroll){
				if(isAllReuslt()) return; 
				//如果没有加载完全部货盘继续加载下一页
				searchResult();
			}
		}
		
		function searchResult(){
			isScroll = false;
			$("#loading").remove();
			$("#workResult").append("<img id='loading' src='${pageContext.request.contextPath}/cts/images/loading.gif'/>");
			$("#seachType").val(seachType);
			
			var path = "${pageContext.request.contextPath}/cts/searchWork.action?isContentFlag=true";
			$("#pageNumber").val(pageNumberVal);
			var params = $("#searchForm").serialize();
			$.ajax({
				type: "POST",
				url:path,
				async:false,
				cache:false,
				data:params,
				success:function(html){
					$("#workResult").append(html);
					pageNumberVal++;
					$("#loading").remove();
					isScroll = true;
				}
			});
			
		}
		
		//Or模糊查询
		function searchDataOr(){
			heartBeat();
			clearAdvanceVal();
			$("#workResult").html('');
		    pageNumberVal = 1;
		    $("#pageNumber").val(1);
			searchResult();
		}
		//select change查询
		function searchDataChange( val ){
			heartBeat();
			$("#workResult").html('');
		    pageNumberVal = 1;
		    $("#pageNumber").val(1);
			searchResult();
			//changeTopSpan( val );
		}
		//高级搜索查询
		function searchDataAdvance( ){
			if( seachType == 2 ){
				var startTime = $('#startTime').val();
				var endTime = $('#endTime').val();
				if( $.trim(startTime).length >0 && $.trim(endTime).length>0 ){
					var arrs1 = startTime.split('-');
	       			var arrs2 = endTime.split('-');
	       			var date1 = new Date(arrs1[0], arrs1[1], arrs1[2], 0, 0, 0);
	        		var date2 = new Date(arrs2[0], arrs2[1], arrs2[2], 0, 0, 0);
	        		if(date1 > date2){
	        			alert('作业时间结束时间不能大于开始时间');
	        			return;
	        		}
				}
			}
			$("#workResult").html('');
		    pageNumberVal = 1;
		    $("#pageNumber").val(1);
		    hidePopDiv('advance_div');
			searchResult();
		}
			
		function heartBeat(){ 
			document.getElementById('workResult').scrollTop=0;
		 	$('#workResult').css('top',0);
		 	document.documentElement.scrollTop = 0;
		 	document.body.scrollTop = 0;
		 }	
		 
		 function clearAdvanceVal(){
		    $('#advance_div').find('input').val('');
		    $('#advance_div').find('select').val('0');
			$('#keyword').pleaseInput('<s:text name="cts.work.searchDefault"/>',{'font-style':'italic','color':'#C5C3C4'});
		 }
		 
		 function addWork( id ){
			var url = '${pageContext.request.contextPath}/cts/addOrEditWork?itemId='+id; 	
			$('#add_work_div_item').hide();
			window.open(url);
		 }
		
		 function showAddDiv(){
		 	$('#add_work_div_item').show();
	 	    $('#statistical_work_div').hide();
		 }
		 function hideAddDiv(){
		 	$('#add_work_div_item').hide();
		 }
		 
		 function hideFloatDiv( idVal ){
			$('.float_div').hide();
		 }
		 function showFloatDiv( idVal ){
		 	$('.float_div').hide();
			$('#float_div_'+idVal).show();
		 }
		 function goHome(){
		 	window.location.href='${pageContext.request.contextPath}/cts/index';
		 }
		 
		 function searchByCountType( countType ){
		 	$('#workingStatus').val(countType);
		 	searchDataChange(countType);
		 }
		 
		 function changeTopSpan( countType ){
		 	for( var i=1;i<=6;i++ ){
		 		if( i == countType ){
		 			//$('#span_parent_'+countType).addClass('on');
		 			$('#span_text_'+countType).addClass('status_style_2');
		 		}else{
		 			$('#span_text_'+i).removeClass();
		 		}
		 	}
		 }
		 
		 function changeStyle1( idVal ){
		 	$('#span_text_'+idVal).removeClass();
		 	$('#span_text_'+idVal).addClass('status_style_2');
		 }
		 function changeStyle2( idVal ){
		 	if( itemType == idVal ) return;
		 	$('#span_text_'+idVal).removeClass();
		 	$('#span_text_'+idVal).addClass('status_style_1');
		 }
		 
		 function changeToPage( val ){	
		 	if( val == 1 ){
		 		window.location.href = "${pageContext.request.contextPath}/cts/searchWork";
		 	}else if( val == 2 ){
		 		window.location.href = "${pageContext.request.contextPath}/cts/searchVerification";
		 	}
		 }
  	</script>
  </body>
</html>
